package com.zzy.factory;
import com.zzy.com.google.gson.Gson;
import com.zzy.card.creditCard;
import com.zzy.card.DiscoverCC;
public class DiscoverFactory implements Factory{
	//单例
    private static DiscoverFactory discoverFactory = null;
    private DiscoverFactory() {
    }
    public static DiscoverFactory getFactory() {
        if (discoverFactory == null) {
           discoverFactory = new DiscoverFactory();
        }
        return discoverFactory;
    }

	@Override
	public creditCard build(String line) {
		// TODO Auto-generated method stub
		Gson gson = new Gson();
        DiscoverCC shortdata = gson.fromJson(line, DiscoverCC.class);
        return shortdata;
	}

	@Override
	public creditCard build2() {
		// TODO Auto-generated method stub
		creditCard creditCard = new DiscoverCC();
        return creditCard;
	}

}
